package com.sys.app.cms;

import java.io.Serializable;

/**
 * 
 * @author sungryoungyu
 * 
 */
public class ImageInfo implements Serializable {
	private static final int NOT_FETCHED = -1;

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String filepath;
	private String color = "";
	private int id  = NOT_FETCHED;
	public int cnt;

	public String getFilepath() {
		return filepath;
	}

	public void setFilepath(String filepath) {
		this.filepath = filepath;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public static ImageInfo valueOf(String photo_path) {
		ImageInfo info = new ImageInfo();
		info.setFilepath(photo_path);
		return info;
	}

	public static ImageInfo valueOf(int id, String photo_path) {
		ImageInfo info = valueOf(photo_path);
		info.setId(id);
		return info;
	}
	
	public static ImageInfo valueOf(int cnt, int id, String photo_path) {
		ImageInfo info = valueOf(photo_path);
		info.setId(id);
		info.cnt = cnt;
		return info;
	}

	@Override
	public String toString() {
		return String.format("%s,%s,%s", id, getFilepath(), getColor());
	}
}
